package com.cx.atguigu.controller;

import com.cx.atguigu.service.ChatAssistant;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Description:
 *
 * @Author atguigu
 * @Create 2025/8/26 0:31
 * @Version 1.0
 */
@Slf4j
@RestController
public class HighApiController {
    @Resource
    private ChatAssistant chatAssistant;

    @GetMapping(value = "/highapi/highapi")
    public String highApi(@RequestParam(value = "prompt", defaultValue = "你是谁") String prompt)
    {
        System.out.println("通过langchain4j调用HighApi大模型的结果为:  "+chatAssistant.chat( prompt));
        return chatAssistant.chat(prompt);
    }

}
